package com.dudsbury.other;


import com.dudsbury.database.DBInterface;
import com.dudsbury.database.Database;
import com.dudsbury.database.DatabaseExtension;
import com.dudsbury.database.DatabaseMySQL;
import com.dudsbury.database.MyCustomer;
import com.dudsbury.database.MyUser;

import com.dudsbury.gui.CreateItemScreen;
import com.dudsbury.gui.CreateUserScreen;
import com.dudsbury.gui.CustomerScreen;
import com.dudsbury.gui.LoginScreen;

public class CustomerCore {
	

	private MyUser user = new MyUser();
	private static MyUser [] data;
	private static boolean userExist = true;
	
	public static void main(String args[]) {
		
		DBInterface database = new DatabaseMySQL();
		database.initialise("root", "", "localhost/dudsbury");
		database.connect();
		DatabaseExtension.setDatabase(database);
		
		
		if(DatabaseExtension.getUsers().length==0){

			userExist = false;
			System.out.print("User Exist is :" + userExist);
			
			}
		System.out.print("User Exist is :" + userExist);
		if(userExist == false){
		
		DatabaseExtension.getDatabase().doSQL("INSERT INTO User VALUES (null, 'administrator', 'ariisawesome', null)");
		
		}
		new LoginScreen();


	}

}

